<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>6</title>
</head>
<body>
    <script>
        // es6 提供了calss 关键字， 让我们用OOP思想写JS
        // 其实只是语法糖， 底层任然是 原型式的面向对象
        class Cat {
            constructor(name, color) {
                this.name = name;
                this.color = color;
            }
            eat() {
                console.log('吃 jerry');
            }
        }
        const cat1 = new Cat('加菲猫','橘色');
        console.log(cat1);
        cat1.eat();
        console.log(cat1.__proto__ , '////', cat1.__proto__.constructor, '///',cat1.__proto__.__proto__,'////',cat1.__proto__.__proto__.__proto__);
    </script>
</body>
</html>